package com.haisen.controller;


import com.haisen.core.utils.PageResultSet;
import com.haisen.dataobject.entity.VerifyCodeHist;
import com.haisen.dataobject.query.VerifyCodeHistQuery;
import com.haisen.service.JobNoService;
import com.haisen.service.VerifyCodeHistService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/verifycode")
@Slf4j
public class VerifyCodeHistController {


    @Autowired
    private VerifyCodeHistService verifyCodeHistService;

    @Autowired
    private JobNoService jobNoService;

    @GetMapping
    public String page(Model model){
        model.addAttribute("jobNoList", jobNoService.list2Tree());
        return "produce/verifycode";
    }

    /**
     * 所有等登录员工都可以看，所以不舍权限
     * @param verifyCodeHistQuery
     * @return
     */
    @RequestMapping("/list")
    @ResponseBody
    public PageResultSet<VerifyCodeHist> findByPage(VerifyCodeHistQuery verifyCodeHistQuery){
        return verifyCodeHistService.findByPage(verifyCodeHistQuery);
    }


}
